<template>
  <view class="paymentSuccess">
    <img src="../static/chargingManager/success.png" alt="" class="successImg">
    <view class="successText">支付成功</view>
    <view class="submit-button-box">
      <view class="submit" @click="goHome">充电管家</view>
      <view class="submit" @click="goHomeBack" v-if="connectorId">去充电</view> 
    </view>
    
  </view>
</template>

<script>
export default {
  data(){
    return{
      // 倒计时
      countdown: 3 ,
      // 1 企业员工认证提交成功 / 2 提现申请提交成功
      type:0,
      timer: null,
      connectorId: ''
    }
  },
  onLoad(options){
    this.connectorId = options.connectorId || ''
    console.log(this.connectorId);
  },
  onUnload(){
    clearInterval(this.timer)
  },
  methods:{
    goHome(){
      uni.redirectTo({
        url: `/pages/charging/chargingManager/index`
      })
    },
    goHomeBack(){
      console.log(this.connectorId);
      uni.redirectTo({
        url: `/pages/charging/chargingManager/devicePopup?scene=${this.connectorId}`
      })
    }
  }
}
</script>

<style scoped>
.paymentSuccess{
  width: 100vw;
  height: 100vh;
  padding: 16px;
  box-sizing: border-box;
  text-align: center;
  background: #F4F5F5;
}
.successImg{
  width: 80px;
  height: 80px;
  margin: 70px auto 0;
}
.successText{
  font-size: 16px;
  color: #1A1A1A;
  margin: 10px 0;
}
.tip{
  font-size: 12px;
  color: #767676;
}
.submit-button-box {
  display: flex;
  justify-content: space-between;
}
.submit{
  width: 150px;
  height: 48px;
  background: #557EFF;
  border-radius: 87px 87px 87px 87px;
  color: #fff;
  text-align: center;
  line-height: 48px;
  margin: 50px auto;
}
</style>